﻿using System.Collections.Generic;
using KataPlotter_v2;
using NUnit.Framework;
namespace KataPlotter_v2_Test
{
    [TestFixture]
    public class KataPlotterPriceCalculator_WithDiscount_MultipleSeries_OneCombination
    {
        private int[] mShoppingBasket_TwoSeries = new int[] { 2, 1 };
        private int[] mShoppingBasket_ThreeSeries = new int[] { 3, 2, 1};
        private int[] mShoppingBasket_FourSeries = new int[] { 4, 3, 2, 1 };

        [Test]
        public void CalculatePrice_TwoSeries()
        {
            var Price = KataPlotterPriceCalculator.CalculatePrice(mShoppingBasket_TwoSeries);
            const double ExpectedPrice = (2*8*0.95) + 8;

            Assert.That(Price, Is.EqualTo(ExpectedPrice));
        }

        [Test]
        public void BuildSeries_OneCombination()
        {
            List<int[]> SeriesList = KataPlotterPriceCalculator.BuildSeriesList(mShoppingBasket_TwoSeries);
            List<int[]> ExpectedSeriesList = new List<int[]>(2);
            ExpectedSeriesList.Add(new int[]{1,1});
            ExpectedSeriesList.Add(new int[] {1});

            Assert.That(SeriesList, Is.EqualTo(ExpectedSeriesList));
        }
    }
}
